package com.nami.store.dubbo;

import com.nami.store.api.request.message.GrpMsgRequest;
import com.nami.store.api.request.message.HisMsgQryRequest;
import com.nami.store.api.request.message.PrivateMsgReq;
import com.nami.store.api.service.RemoteMessageService;
import com.nami.store.api.response.message.MessageDTO;
import com.nami.store.biz.grphismsgs.application.GrpMsgAppService;
import com.nami.store.biz.privatehismsgs.application.PrivateMsgsAppService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;

/**
 * 描述：
 *
 * @Author: lbc
 * @Date: 2023-07-28 8:49
 * @email: 594599620@qq.com
 * @Description: keep coding
 */
@Slf4j
@DubboService
@AllArgsConstructor
public class RemoteMessageServiceImpl implements RemoteMessageService {

    private final PrivateMsgsAppService privateMsgsAppService;

    private final GrpMsgAppService grpMsgAppService;

    @Override
    public boolean savePrivateMsg(PrivateMsgReq request) {
        return privateMsgsAppService.storePrivateMsg(request);
    }

    @Override
    public boolean saveGrpMsg(GrpMsgRequest request) {
        return grpMsgAppService.storeGrpMessage(request);
    }

    @Override
    public List<MessageDTO> getPrivateHisMsgs(HisMsgQryRequest request) {
        return privateMsgsAppService.getHisMsgs(request);
    }

    @Override
    public List<MessageDTO> getGrpHisMsgs(HisMsgQryRequest request) {
        return grpMsgAppService.getHisMsgs(request);
    }
}
